package homework.Abstract;

public class EmployeeTest {
    public static void main(String[] args) {
        // 创建员工对象
        Employee[] employees = {
                new FullTimeEmployee("张三", "FT001", 15000.0),
                new PartTimeEmployee("李四", "PT001", 50.0, 80),
                new FullTimeEmployee("王五", "FT002", 18000.0),
                new PartTimeEmployee("赵六", "PT002", 60.0, 120)
        };
        // 计算并显示每位员工的工资
        System.out.println("=== 员工薪资报告 ===");
        for (Employee emp : employees) {
            System.out.println(emp);
            System.out.printf("本月工资: %.2f元\n\n", emp.calculateSalary());
        }
        // 计算总工资支出
        double totalSalary = 0;
        for (Employee emp : employees) {
            totalSalary += emp.calculateSalary();
        }
        System.out.printf("=== 总工资支出: %.2f元 ===\n", totalSalary);
    }
}
